from base import Base
from time import sleep
from selenium.webdriver.common.by import By

class SouSuoPage(Base):

    sousuokuang=(By.XPATH,'//android.widget.TextView[@test="搜索菜谱"]')

    shurukuang=(By.ID,'com.xiachufang:id/search_edit_text')

    sousuotag=(By.XPATH,'//android.widget.TextView[@test="搜索"]')

    dy = 'new UiSelector().resourceId("com.xiachufang:id/tv_content")'

    def sousuoyewu(self,content):
        self.find_ele(self.sousuokuang).click()
        sleep(2)
        self.find_ele(self.shurukuang).send_keys(content)
        sleep(2)
        self.find_ele(self.sousuotag).click()
        sleep(2)
